package site.zhangzhuo.v3;

import java.nio.charset.Charset;

public class Main {

    public static void main(String[] args) {
        //获取默认编码
        System.out.println("系统默认编码：" + System.getProperty("file.encoding"));
        System.out.println("系统默认字符编码:" + Charset.defaultCharset());
        System.out.println("系统默认语言:" + System.getProperty("user.language"));

        Xin zhuo=new Xin();
        Yan yan=new Yan();
        zhuo= Xin.load("data/XinV3");

        //yan.clear();
        //yan.readFile("data/现代汉语一级字3500.txt");
        //zhuo.learnZiFromTable(yan);

        yan.clear();
        yan.readFile("data/老舍/四世同堂.txt");
        zhuo.learnZiFromArticle(yan);

        yan.clear();
        yan.readFile("data/老舍/骆驼祥子.txt");
        zhuo.learnZiFromArticle(yan);

        yan.clear();
        yan.readFile("data/老舍/茶馆.txt");
        zhuo.learnZiFromArticle(yan);



        /*
        Feature feat1=zhuo.featureOfArticle(yan);
        yan.clear();
        yan.readFile("data/老舍/茶馆.txt");
        Feature feat2=zhuo.featureOfArticle(yan);
        float rst=feat1.likePercent(feat2);
        System.out.println("文章相似度："+rst);
         */

        if (zhuo != null) {
            System.out.println("心量："+zhuo.size());
            //System.out.println(zhuo);
            zhuo.save("data/XinV3");
            zhuo.printToFile("data/zhuo.txt");
        }
    }


}